import { axios, VueAxios } from '@/utils/request'

export function accountList(params) {
  return axios({
    url: '/school/users',
    method: 'post', 
    data: params
  })
}
//   
export function accountCreate(params) {
  return axios({
    url: '/school/users/create',
    method: 'post',
    data: params
  })
}


export async function accountDel(params) {
  return await axios({
    url: '/school/users/valid-state',
    method: 'post',
    data: params
  })
}
// /users/exit-switch
//移出并离职
export async function moveAndDel(params) {
  return await axios({
    url: '/school/users/delete',
    method: 'post',
    data: params
  })
}
export async function changeOnJobType(params) {
  return await axios({
    url: '/school/users/exit-switch',
    method: 'post',
    data: params
  })
}
export async function accountSureDel(params) {
  return await axios({
    url: '/school/users/delete',
    method: 'post',
    data: params
  })
}
export function accountEdit(params, id) {
  return axios({
    url: '/school/users/' + id + '/update',
    method: 'post',
    data: params
  })
}
export function accountInfo(params, id) {
  return axios({
    url: '/school/users/' + id,
    method: 'post',
    data: params
  })
}

export function roleList(params) {
  return axios({
    url: '/school/user-roles',
    method: 'post',
    data: params
  })
}


export function addRole(params) {
  return axios({
    url: '/school/user-roles/create',
    method: 'post',
    data: params
  })
}

export function editRole(params,id) {
  return axios({
    url: '/school/user-roles/'+id+'/update',
    method: 'post',
    data: params
  })
}
export function roleInfo(id,data) {
  return axios({
    url: '/school/user-roles/' + id,
    method: 'post',
    data:data
  })
}
export function dataList(params) {
  return axios({
    url: '/school/user-roles/permission-list',
    method: 'post',
    data: params
  })
}

export function roleDel(id) {
  return axios({
    url: '/school/user-roles/' + id+'/delete',
    method: 'post',
  })
}


